package com.example.gulimall.cart.service;

import com.example.gulimall.cart.vo.CartItemVo;
import com.example.gulimall.cart.vo.CartVo;

import java.util.concurrent.ExecutionException;

/**
 * @author gulin
 * @date 2021/8/17 11:04
 */
public interface CartService {


    /**
     * 获取登陆或者未登陆购物车所有信息
     * @return: com.example.gulimall.cart.vo.CartVo 购物货品
     * @author gulin
     * @date 11:07 2021/8/17
     **/
    CartVo getCart() throws ExecutionException, InterruptedException;

    /**
     * 将商品添加至购物车
     * @param skuId 商品ID
     * @param num  数量
     * @return: com.example.gulimall.cart.vo.CartItemVo 购物项
     * @author gulin
     * @date 11:15 2021/8/17
     **/
    CartItemVo addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;


    CartItemVo getCartItem(Long skuId);

    /**
     * 清空购物车信息
     * @param cartKey
     * @return: void
     * @author gulin
     * @date 15:35 2021/8/27
     **/
    public void clearCartInfo(String cartKey);
}
